package com.winit.schedule.webc.support;

import java.util.Map;

public class ControllerDelegate {

    String                     namespace;

    Object                     controller;

    Map<String, MethodMapping> methodMappings;

    public ControllerDelegate(String namespace, Object controller){
        this.namespace = namespace;
        this.controller = controller;
    }

    public boolean checkRequestMapping(String namespace, String requestMapping) {
        if (namespace.equals(namespace) && methodMappings.containsKey(requestMapping)) {
            return true;
        }
        return false;
    }

    public MethodMapping getMethodMapping(String requestMapping) {
        return methodMappings.get(requestMapping);
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public Object getController() {
        return controller;
    }

    public void setController(Object controller) {
        this.controller = controller;
    }

    public Map<String, MethodMapping> getMethodMappings() {
        return methodMappings;
    }

    public void setMethodMappings(Map<String, MethodMapping> methodMappings) {
        this.methodMappings = methodMappings;
    }

}
